package com.demo.autocomplete;

import java.util.ArrayList;

import org.directwebremoting.annotations.RemoteMethod;
import org.directwebremoting.annotations.RemoteProxy;

@RemoteProxy
public class MyTool {
	@RemoteMethod
	public String[] getCountries(String input) {
		return getDataFromDB(input);
	}

	@SuppressWarnings("unchecked")
	private String[] getDataFromDB(String input) {
		
		
		ArrayList itemCode = (ArrayList)MyToolBO.find(input);
				
		String[] temp = (String[]) itemCode.toArray(new String[]{});
		System.out.print("***length of temp" + temp.length);
		
		return temp;
	}
}
